home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00105_Name entry.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.7 KB  |  54 lines

  1. property pSpr
  2. global gNameChosen
  3.  
  4. on beginSprite me
  5.   pSpr = sprite(me.spriteNum)
  6.   pSpr.editable = 1
  7.   nameList = ["Your Name Here", "Barmeister 3000", "Sidney B. Artender", "Art Chainletter", "Poochie", "Bildo N. Dinky", "Rob Petri", "Laura Petulent", "Rhett Butler", "Ed Fong", "The Judge", "Alice Days", "Tropolis Van Ness", "Spyke Smith", "L. Dorado Hubbcap", "Amanda Huginkiss", "Zargon", "Barbara Anne", "Filthy McNasty", "Elizabeth Reed", "Uncle Sid", "Gilly Bates", "Suzanne Modesky", "Kaiser Roll", "Spot Check Billy", "Gregory Peccary", "Vornado Velatio", "Seve Bourbanis", "Boris Rourke", "Bruno", "Mickey Yeltsin", "Harvey Wallbanger", "Tom Collins", "Sam Malloy", "Lowell Washington", "Red", "Arnie 'The Professor' Morris", "Vincent van Hedgehog", "Rob Roy", "Tony Clifton", "Shirley Temple"]
  8.   if not gNameChosen then
  9.     chosen = randomFromList(nameList)
  10.     pSpr.member.text = chosen
  11.     hilite line 1 of field the member of pSpr
  12.   end if
  13. end
  14.  
  15. on endSprite me
  16.   global gPlayerName
  17.   gPlayerName = pSpr.member.text
  18.   pSpr.editable = 0
  19. end
  20.  
  21. on keyDown me
  22.   case the key of
  23.     24:
  24.       nothing()
  25.       dontPassEvent()
  26.       exit
  27.   end case
  28.   case the keyCode of
  29.     117, 51, 123, 124:
  30.       pass()
  31.       exit
  32.     53:
  33.       quitSequence()
  34.       abort()
  35.   end case
  36.   case the key of
  37.     ENTER, RETURN, TAB:
  38.       sendSprite(me.spriteNum - 1, #mouseUp)
  39.     otherwise:
  40.       gNameChosen = 1
  41.       if onPC() then
  42.         slop = 3
  43.       else
  44.         slop = 1
  45.       end if
  46.       if (charPosToLoc(pSpr.member, pSpr.member.text.length).locH > (pSpr.width - (slop * pSpr.member.fontSize))) and (the selStart = the selEnd) then
  47.         beep()
  48.         dontPassEvent()
  49.       else
  50.         pass()
  51.       end if
  52.   end case
  53. end
  54.